// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package com.jrsystems.jrbase.role.service;

import com.jrsystems.jrbase.role.Role;
import com.jrsystems.jrbase.role.RoleDao;
import com.jrsystems.jrbase.role.vo.RoleVO;

/**
 * @see com.jrsystems.jrbase.role.service.RoleService
 */
public class RoleServiceImpl
    extends com.jrsystems.jrbase.role.service.RoleServiceBase
{

    /**
     * @see com.jrsystems.jrbase.role.service.RoleService#saveRole(com.jrsystems.jrbase.role.vo.RoleVO)
     */
    protected  com.jrsystems.jrbase.role.vo.RoleVO handleSaveRole(com.jrsystems.jrbase.role.vo.RoleVO roleVO)
        throws java.lang.Exception
    {
    	Role role = getRoleDao().roleVOToEntity(roleVO);
    	if(roleVO.getId() == null){
    		roleVO = getRoleDao().toRoleVO(getRoleDao().create(role));
    	} else{
    		getRoleDao().update(role);
    	}
    	
    	return roleVO;
    }

    /**
     * @see com.jrsystems.jrbase.role.service.RoleService#getAllRoles()
     */
    protected  com.jrsystems.jrbase.role.vo.RoleVO[] handleGetAllRoles()
        throws java.lang.Exception
    {
        return (RoleVO[]) getRoleDao().loadAll(RoleDao.TRANSFORM_ROLEVO).toArray();
    }

    /**
     * @see com.jrsystems.jrbase.role.service.RoleService#getRolesByClearance(com.jrsystems.jrbase.clearancelevel.vo.ClearanceLevelVO)
     */
    protected  com.jrsystems.jrbase.role.vo.RoleVO[] handleGetRolesByClearance(com.jrsystems.jrbase.clearancelevel.vo.ClearanceLevelVO clearanceVO)
        throws java.lang.Exception
    {
        // @todo implement protected  com.jrsystems.jrbase.role.vo.RoleVO[] handleGetRolesByClearance(com.jrsystems.jrbase.clearancelevel.vo.ClearanceLevelVO clearanceVO)
        throw new java.lang.UnsupportedOperationException("com.jrsystems.jrbase.role.service.RoleService.handleGetRolesByClearance(com.jrsystems.jrbase.clearancelevel.vo.ClearanceLevelVO clearanceVO) Not implemented!");
    }

    /**
     * @see com.jrsystems.jrbase.role.service.RoleService#getRoleClearance(com.jrsystems.jrbase.role.vo.RoleVO)
     */
    protected  com.jrsystems.jrbase.clearancelevel.vo.ClearanceLevelVO[] handleGetRoleClearance(com.jrsystems.jrbase.role.vo.RoleVO roleVO)
        throws java.lang.Exception
    {
    	//return roleVO.ge
        // @todo implement protected  com.jrsystems.jrbase.clearancelevel.vo.ClearanceLevelVO[] handleGetRoleClearance(com.jrsystems.jrbase.role.vo.RoleVO roleVO)
        throw new java.lang.UnsupportedOperationException("com.jrsystems.jrbase.role.service.RoleService.handleGetRoleClearance(com.jrsystems.jrbase.role.vo.RoleVO roleVO) Not implemented!");
    }

}